<%@ Page Language="C#" AutoEventWireup="true" CodeFile="answer-question.aspx.cs" Inherits="board_answer_question" MasterPageFile="~/MasterPage.master" ValidateRequest="false" Async="true"
    MaintainScrollPositionOnPostback="true" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Call Center Employment | Teledirect</title>
    <meta name="Description" content="Teledirect has openings in Call Center Jobs In countries like Singapore, Malaysia, Thailand, Hong Kong and Indonesia."/>
    <meta name="keywords" content="Call Center Jobs,Call Center Employment,Inbound Call Center Jobs,Outsourcing Call Center Jobs,Outbound Call Center Jobs,Customer Call Center Jobs,Call Center Consultants,BPO Jobs In Asia"/>
    <link rel="image_src" href="/images/public/snapshot_careers.jpg" />
    <meta name="Author" content="Teledirect Authorship - Outsourcing" />
    <meta name="revisit-after" content="10 days" />
    <meta name="content-language" content="en" />
    <!-- Scripts  |  Start  -->
    
    <script type="text/javascript">
        $(document).ready(function() {
            $().UItoTop({ easingType: 'easeOutQuart' });
        });

        $("#op").css({ opacity: 0.5 });
    </script>

    <!-- Scripts  |  End    -->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" runat="Server">
    <!-- Showcase Banner  |  Start -->
    <div id="showcase">
        <div id="canvas" class="contact">
            <!-- #Include file="../includes/showcase_nav.inc" -->
            <div class="grid z25">
            </div>
            <div class="q z20">
            </div>
            <div class="bg z15">
            </div>
            <div id="cloud_small" class="cloud_contact z15">
            </div>
        </div>
    </div>
    <!-- Showcase Banner  |  End   -->
    <div class="seperator">
    </div>
    <div id="body">
        <!-- Right Column | Start -->
        <div class="col_left">
            <div class="menu">
                <ul>
                    <li><a href="#" class="select">Answer questions</a></li>
                    <li id="liLogout" runat="server" visible="false"><a href="../board/logout.aspx">Logout</a></li>
                </ul>
            </div>
        </div>
        <!-- Right Column | End   -->
        <!-- Content Column | Start -->
        <div class="col_mid">
            <!-- Quick Nav [Prev / Next]  |  Start  -->
            <!-- Quick Nav [Prev / Next]  |  End    -->
            <h1 class="heading">
                <asp:Label runat="server" ID="lblFormTitle" Text="Answer questions" /></h1>
            <div class="content_full_655">
                <div id="divAppForm">
                    <asp:Label runat="server" ID="lblMessage" ForeColor="Red" />
                    <asp:UpdatePanel ID="uplResult" runat="server">
                        <ContentTemplate>
                            <div style="width: 97%; background-color: #FFFFCC; padding-left: 20px" height:30px>
                                Search&nbsp;&nbsp;&nbsp;<asp:TextBox runat="server" ID="txtSearch" MaxLength="200" 
                                    Width="300px" />&nbsp;&nbsp;&nbsp;&nbsp;Published&nbsp;&nbsp;&nbsp;<asp:DropDownList runat="server" ID="ddlPublish">
                                    <asp:ListItem Selected="True" Value="2" Text="All"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                    <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                    </asp:DropDownList>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:ImageButton runat="server" ID="btnSearch" ImageAlign="AbsMiddle" 
                                    ImageUrl="~/images/showcase/board/search32.png" onclick="btnSearch_Click" /><br />
                                Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox runat="server" ID="txtSearchName" MaxLength="200" 
                                    Width="100px" />&nbsp;&nbsp;&nbsp;&nbsp;Email&nbsp;&nbsp;&nbsp;<asp:TextBox runat="server" ID="txtSearchEmail" MaxLength="200" 
                                    Width="100px" />&nbsp;&nbsp;&nbsp;&nbsp;Phone&nbsp;&nbsp;&nbsp;<asp:TextBox runat="server" ID="txtSearchPhone" MaxLength="100" 
                                    Width="100px" />
                            </div>
                            <asp:DataGrid runat="server" ID="grdResult" AllowPaging="true" AutoGenerateColumns="false"
                                OnPageIndexChanged="grdResult_Change" PageSize="10" Width="100%" ShowHeader="false"
                                OnItemCommand="grdResult_ItemCommand" >
                                <Columns>
                                    <asp:TemplateColumn>
                                        <ItemTemplate>
                                            <div style="width: 98%; padding-left: 10px">
                                                <div style="float: left; background-color: #D7D7D7; width: 90%">
                                                    <asp:Image runat="server" ID="imgPublish" ToolTip="Published" ImageAlign="AbsMiddle"
                                                        ImageUrl="~/images/showcase/board/page_accept24.png" Visible='<%# DataBinder.Eval(Container.DataItem, "IsPublished")%>' />&nbsp;<asp:Label
                                                            runat="server" ID="lblSubject" Text='<%# DataBinder.Eval(Container.DataItem, "Subject")%>'></asp:Label><asp:HiddenField
                                                                runat="server" ID="hidBoardId" Value='<%# DataBinder.Eval(Container.DataItem, "CEOBoardId")%>' />
                                                </div>
                                                <div style="float: right">
                                                    <asp:ImageButton runat="server" ID="imgBtnEdit" ImageUrl="~/images/showcase/board/edit24.png"
                                                        CommandName="editboard" />&nbsp;<asp:ImageButton runat="server" ID="imgBtnDelete"
                                                            ImageUrl="~/images/showcase/board/delete24.png" CommandName="deleteboard" OnClientClick="return DeleteConfirm();" /></div>
                                            </div>
                                            <br />
                                            <div style="padding-left: 10px">
                                                <span style="font-family: Tahoma; font-size: 18px; color: #FF6600; font-weight: bold;
                                                    width: 50px">Q</span>&nbsp;&nbsp;<asp:Literal runat="server" ID="lblQuestion" Text='<%# DataBinder.Eval(Container.DataItem, "Question").ToString().Replace("\r\n", "<br>").Replace("\n", "<br>")%>'></asp:Literal></div>
                                            <div style="padding-left: 10px">
                                                <span style="font-family: Tahoma; font-size: 18px; color: #FF6600; font-weight: bold;
                                                    width: 50px">A</span>&nbsp;&nbsp;<asp:Literal runat="server" ID="lblAnswer" Text='<%# DataBinder.Eval(Container.DataItem, "Answer")%>'></asp:Literal>
                                                    </div>
                                            <br />
                                            <div style="padding-left: 10px; font-size:12px"><b>Asked by:</b>&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "Name")%>&nbsp;&nbsp;<b>Email:</b>&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "Email")%>&nbsp;&nbsp;<b>Phone#:</b>&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "Phone")%></div>
                                            <hr style="width: 90%" />
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                </Columns>
                                <PagerStyle Mode="NumericPages" HorizontalAlign="Right"></PagerStyle>
                            </asp:DataGrid>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div id="divPopup">
                        <div style="margin: 0 auto; width: 266px; text-align: center; display: none;">
                            <asp:Button ID="btnTest" runat="server" Text="Button" />
                        </div>
                        <asp:ModalPopupExtender ID="mpeAnswer" runat="server" Enabled="true" TargetControlID="btnTest"
                            PopupControlID="pnlAnswer" DropShadow="true"
                            BehaviorID="mdlPopupAnswer">
                        </asp:ModalPopupExtender>
                        <asp:Panel ID="pnlAnswer" runat="server" Style="display: none; background-color: White;"
                            >
                            <asp:UpdatePanel ID="upAnswer" runat="server">
                                <ContentTemplate>
                                    <table width="100%" cellpadding="3" cellspacing="3" style="border: 9px solid #3b3b3b;">
                                        <tr>
                                            <td colspan="3">
                                                <h2>
                                                    <asp:Label runat="server" ID="lblFormSubTitle" Text="Answer" />
                                                </h2>
                                                <br />
                                                <span style="display: none; color: Red; font-weight: bold; font-size: small">All fields
                                                    are required.</span>
                                                <asp:ValidationSummary runat="server" ID="vsApplyNow" ValidationGroup="applynow"
                                                    ShowSummary="false" ShowMessageBox="true" HeaderText="Opps.., please complete all (*) field(s)." />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="170px">
                                                Subject
                                            </td>
                                            <td>
                                                :
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtSubject" MaxLength="1000" Width="600px" />
                                                <asp:RequiredFieldValidator runat="server" ID="rfvSubject" ControlToValidate="txtSubject"
                                                    ValidationGroup="applynow" Display="Dynamic" ErrorMessage="Please enter a subject."
                                                    Text="*" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="170px">
                                                Question
                                            </td>
                                            <td>
                                                :
                                            </td>
                                            <td id="tdQuestion" runat="server">
                                                <asp:TextBox runat="server" ID="txtQuestion" MaxLength="4000" TextMode="MultiLine"
                                                    Width="600px" Height="80px"></asp:TextBox>
                                                <%--<asp:HtmlEditorExtender ID="editorQuestion" runat="server" TargetControlID="txtQuestion">
                                                    <Toolbar>
                                                        <asp:Bold />
                                                        <asp:Italic />
                                                        <asp:Underline />
                                                        <asp:StrikeThrough />
                                                        <asp:Copy />
                                                        <asp:Cut />
                                                        <asp:Paste />
                                                        <asp:Delete />
                                                        <asp:FontNameSelector />
                                                        <asp:FontSizeSelector />
                                                        <asp:ForeColorSelector />
                                                        <asp:HorizontalSeparator />
                                                        <asp:Indent />
                                                        <asp:Outdent />
                                                        <asp:InsertHorizontalRule />
                                                        <asp:InsertOrderedList />
                                                        <asp:InsertUnorderedList />
                                                        <asp:JustifyCenter />
                                                        <asp:JustifyFull />
                                                        <asp:JustifyLeft />
                                                        <asp:JustifyRight />
                                                        <asp:RemoveFormat />
                                                        <asp:Superscript />
                                                        <asp:Subscript />
                                                        <asp:Redo />
                                                        <asp:Undo />
                                                        <asp:CreateLink />
                                                        <asp:UnLink />
                                                        <asp:SelectAll />
                                                        <asp:UnSelect />
                                                    </Toolbar>
                                                </asp:HtmlEditorExtender>--%>
                                                <asp:RequiredFieldValidator runat="server" ID="rfvQuestion" ControlToValidate="txtQuestion"
                                                    ValidationGroup="applynow" Display="Dynamic" ErrorMessage="Please enter a question."
                                                    Text="*" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="170px">
                                                Answer
                                            </td>
                                            <td>
                                                :
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtAnswer" MaxLength="4000" TextMode="MultiLine"
                                                    Width="600px" Height="240px"></asp:TextBox>
                                                <asp:HtmlEditorExtender ID="editorAnswer" runat="server" TargetControlID="txtAnswer" OnClientChange="onContentsChange">
                                                    <Toolbar>
                                                        <asp:Bold />
                                                        <asp:Italic />
                                                        <asp:Underline />
                                                        <asp:StrikeThrough />
                                                        <asp:Copy />
                                                        <asp:Cut />
                                                        <asp:Paste />
                                                        <asp:Delete />
                                                        <asp:FontNameSelector />
                                                        <asp:FontSizeSelector />
                                                        <asp:ForeColorSelector />
                                                        <asp:HorizontalSeparator />
                                                        <asp:Indent />
                                                        <asp:Outdent />
                                                        <asp:InsertHorizontalRule />
                                                        <asp:InsertOrderedList />
                                                        <asp:InsertUnorderedList />
                                                        <asp:JustifyCenter />
                                                        <asp:JustifyFull />
                                                        <asp:JustifyLeft />
                                                        <asp:JustifyRight />
                                                        <asp:RemoveFormat />
                                                        <asp:Superscript />
                                                        <asp:Subscript />
                                                        <asp:Redo />
                                                        <asp:Undo />
                                                        <asp:CreateLink />
                                                        <asp:UnLink />
                                                        <asp:SelectAll />
                                                        <asp:UnSelect />
                                                    </Toolbar>
                                                </asp:HtmlEditorExtender>
                                                <asp:RequiredFieldValidator runat="server" ID="rfvAnswer" ControlToValidate="txtAnswer"
                                                    ValidationGroup="applynow" Display="Dynamic" ErrorMessage="Please enter an answer."
                                                    Text="*" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="170px">
                                            </td>
                                            <td>
                                            </td>
                                            <td><asp:CheckBox runat="server" ID="chkPublish" Text="Publish" /></td>
                                        </tr>
                                        <tr>
                                            <td width="170px">
                                                Asked by
                                            </td>
                                            <td>
                                                :
                                            </td>
                                            <td><asp:Literal runat="server" ID="lblAskedBy"></asp:Literal>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="170px">
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                                <asp:Button runat="server" ID="btnSubmitForm" OnClick="btnSubmitForm_Click" CausesValidation="true"
                                                    ValidationGroup="applynow" Text="Submit" Width="120px" Height="35px" Font-Bold="true" />&nbsp;&nbsp;<asp:Button runat="server" ID="btnClose" CausesValidation="false"
                                                    Text="Close" Width="120px" Height="35px" Font-Bold="true" OnClientClick="HideBoardPopup();ShowHideBoardPanel(true);" />
                                                <asp:Label runat="server" ID="lblSubmitMessage" ForeColor="Red" /><asp:HiddenField runat="server" ID="hidBId" /><asp:HiddenField runat="server" ID="hidAnswerQuestion" />
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </asp:Panel>
                    </div>
                </div>
            </div>
        </div>
        <!-- Content Column | Start -->
        <div class="clear">
        </div>
    </div>
    <div class="seperator">
    </div>

    <script type="text/javascript">
        
        function ShowHideBoardPanel(OnOff) {
            if (OnOff == true) {
                document.getElementById('<%=pnlAnswer.ClientID%>').style.display = 'none';
            }
            else {
                document.getElementById('<%=pnlAnswer.ClientID%>').style.display = '';
            }
        }

        function HideBoardPopup() {
            var modpop = $find("mdlPopupAnswer");

            if (!modpop) { return; }
            modpop.hide()
        }

        function DeleteConfirm() {
            var _retVal = false;
            _retVal = confirm('Do you confirm to DELETE?');
            return _retVal;
        }

        function onContentsChange() {
            $('#<%=hidAnswerQuestion.ClientID%>').val($('#<%=txtAnswer.ClientID%>').val());
        }

//        $(document).ready(function() {
//            $('#<%=tdQuestion.ClientID%>').bind("paste", function(e) {
//                e.preventDefault(); //cut copy 
//            });
//        });


    </script>

</asp:Content>
